package com.example.client;

import com.example.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 使用feign调用服务A的接口
 */
@FeignClient("SERVER-A") //指定服务A的名称
public interface ServerAClient {
    @GetMapping("/noParameter")
    String noParameter();

    @GetMapping("/singleParameter/{id}")
    String singleParameter(@PathVariable("id") Integer id);

    @GetMapping("/multipleParameter")
    String multipleParameter(@RequestParam("id") Integer id, @RequestParam("age") Integer age);

    @PostMapping("/complexObject")
    User complexObject(@RequestBody User user);
}
